<!-- DBEUG调试 -->
<div id="think_page_trace"
	style="position: fixed; bottom: 0; right: 0; font-size: 14px; width: 100%; z-index: 999999; color: #000; text-align: left; font-family: '微软雅黑';">
	<div id="think_page_trace_tab"
		style="display: none; background: white; margin: 0; height: 250px;">
		<div id="think_page_trace_tab_tit"
			style="height: 30px; padding: 6px 12px 0; border-bottom: 1px solid #ececec; border-top: 1px solid #ececec; font-size: 16px">
			<span
				style="color: #000; padding-right: 12px; height: 30px; line-height: 30px; display: inline-block; margin-right: 3px; cursor: pointer; font-weight: 700">基本</span>
			<span
				style="color: #000; padding-right: 12px; height: 30px; line-height: 30px; display: inline-block; margin-right: 3px; cursor: pointer; font-weight: 700">SQL语句</span>
		</div>
		<div id="think_page_trace_tab_cont"
			style="overflow: auto; height: 212px; padding: 0; line-height: 24px">
			<div style="display: none;">
				<ol style="padding: 0; margin: 0">
					{{ range $index, $value := .}}
					<li style="border-bottom: 1px solid #EEE; font-size: 14px; padding: 0 12px">
						属性:{{$index}} 值:{{$value}}
					</li>
					{{end}}
				</ol>
			</div>
			<div style="display: none;">
				<ol style="padding: 0; margin: 0">
					<li style="border-bottom: 1px solid #EEE; font-size: 14px; padding: 0 12px">SQL错误</li>
				</ol>
			</div>
		</div>
	</div>
	<div id="think_page_trace_close"
		style="text-align: right; height: 15px; position: absolute; top: 10px; right: 12px; cursor: pointer;">
		<img style="vertical-align: top;" src="/public/img/close.gif" />
	</div>
</div>
<div id="think_page_trace_open"
	style="height: 30px; float: right; text-align: right; overflow: hidden; position: fixed; bottom: 0; right: 0; color: #000; line-height: 30px; cursor: pointer;">
	<div style="background: #232323; color: #FFF; padding: 0 6px; float: right; line-height: 30px; font-size: 14px">
		调试
	</div>
	<img width="30" style="" title="ShowPageTrace" src="/public/img/think.png">
</div>
<script type="text/javascript">
	$(document).ready(function() {
		var tab_tit = $("#think_page_trace_tab_tit").find("span")
		var tab_cont = $("#think_page_trace_tab_cont").find("div")
		var open = $("#think_page_trace_open")
		var close = $("#think_page_trace_close")
		var trace = $("#think_page_trace_tab")
		var cookie = document.cookie.match(/thinkphp_show_page_trace=(\d\|\d)/);
		var history = (cookie && typeof cookie[1] != 'undefined' && cookie[1].split('|')) || [ 0, 0 ];

		open.click(function(){
			trace.css("display","block");
			$(this).css("display","none");
			close.parent().css("display","block");
			history[0] = 1;
			document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
		});

		close.click(function(){
			trace.css("display","none");
			$(this).parent().css("display","none");
			open.css("display","block");
			history[0] = 0;
			document.cookie = 'thinkphp_show_page_trace=' + history.join('|')
		});

		for ( var i = 0; i < tab_tit.length; i++) {
			tab_tit[i].onclick = (function(i) {
				return function() {
					for ( var j = 0; j < tab_cont.length; j++) {
						tab_cont[j].style.display = 'none';
						tab_tit[j].style.color = '#999';
					}
					tab_cont[i].style.display = 'block';
					tab_tit[i].style.color = '#000';
					history[1] = i;
					document.cookie = 'thinkphp_show_page_trace='+ history.join('|')
				}
			})(i)
		}
		parseInt(history[0]) && open.click();
		tab_tit[history[1]].click();
	});
</script>
<!-- DBEUG调试 -->